﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="finance_settlement_current.aspx.cs" Inherits="SF.Ucenter.admin.finance.finance_settlement_current" %>

<%@ Import Namespace="SF.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>生成结算单</title>
    <link href="../../scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../../css/pagination.css" rel="stylesheet" type="text/css" />
    <link href="../../css/validate.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/datepicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script> 
    
    <style type="text/css">
        .date-input {
            width:130px;
        }
    </style>
    <script type="text/javascript">
        function createsettlement() {
            $.ajax({
                url: "finance_settlement_current.aspx",
                type: "get",
                cache: false,
                data: { action: 'CreateSettlement', begintime: $("#txtbegintime").val(), endtime: $("#txtendtime").val() },
                success: function (data) {
                    var obj = eval("(" + data + ")");

                    if (obj.msg.length > 0) {
                        var winDialog = top.dialog({
                            title: '提示',
                            content: obj.msg,
                            okValue: '确定',
                            ok: function () { }
                        }).showModal();

                    } else {
                        var winDialog = top.dialog({
                            title: '提示',
                            content: "订单结算生成成功！",
                            okValue: '确定',
                            ok: function () {
                                window.location.href = "finance/finance_settlement_current.aspx?settleNum=" + obj.settleNum;
                            }
                        }).showModal();
                    }
                },
                complete: function(){ },
                error: function () { }
            });
        }
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <asp:HiddenField ID="hdSettleNum" runat="server" Value="" />
        <!--导航栏-->
        <div class="location"> 
            <a href="../center.aspx" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <span>生成财务结算单</span>
        </div>
        <!--/导航栏--> 
        <!--工具栏-->
        <div id="floatHead" class="toolbar-wrap">
            <div class="toolbar">
                <div class="box-wrap">
                    <a class="menu-btn"></a> 
                    <div class="l-list">
                        <ul class="icon-list">

                            <li><asp:TextBox ID="txtbegintime" Width="120px" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " nullmsg="开始日期" /></li>
                            <li><span class="keywordtip">—&nbsp;&nbsp;</span></li>
                            <li><asp:TextBox ID="txtendtime" Width="120px" runat="server" CssClass="input rule-date-input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " nullmsg="结束日期" /></li>

                            <li><a class="add" href="javascript:createsettlement();"><i></i><span>生成结算单</span></a></li>
                        </ul>
                    </div>
                    
                </div>
            </div>
        </div>
        <!--/工具栏-->

        <!--列表-->
        <div class="table-container">
            <table style="width:100%;margin-bottom:10px;">
                <tr style="width:100%;">
                    <td style="width:33%;font-size:12px;" align="left">
                        结算单编号&nbsp;&nbsp;:&nbsp;&nbsp;
                        <asp:Label ID="lbsettlement_num" style="border-bottom:1px solid black;" Width="135px" runat="server"></asp:Label>
                    </td>
                    <td style="width:33%;font-size:12px;" align="center">
                        操作人员&nbsp;&nbsp;:&nbsp;&nbsp;
                        <asp:Label ID="lboperator"  style="border-bottom:1px solid black;" Width="80px" runat="server"></asp:Label>
                    </td>
                    <td style="width:33%;font-size:12px;" align="right">
                        生成时间&nbsp;&nbsp;:&nbsp;&nbsp;
                        <asp:Label ID="lbcreate_time"  style="border-bottom:1px solid black;" Width="120px" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
            <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                    <tr>                       
                        <th width="16%">商户编号</th>
                        <th width="16%">商户名称</th>
                        <th width="13%">结算金额(元)</th>
                        <th width="15%">生成时间</th>
                        <th width="8%">状态</th>
                    </tr>
                    <tbody class="ltbody">

                </HeaderTemplate>
                <ItemTemplate>
                    <tr>                    
                        <td align="center"><asp:HiddenField ID="hidId" runat="server" Value='<%#Eval("id")%>' /><%#Eval("busnieseNum")%></td>
                        <td align="center"><%#Eval("businessName")%></td>
                        <td align="center"><%#Eval("total_amount")%></td>
                        <td align="center"><%#Eval("create_time")%></td>
                        <td align="center"><span title="<%# Eval("state").ToString() == "1" ?"已完成收费":"未完成收费" %>" class="<%# Eval("state").ToString() == "1" ?"Validform_right":"Validform_wrong" %>"></span></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                        <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"5\">暂无记录</td></tr>" : ""%>
                    </tbody>
                    </table>
                </FooterTemplate>
            </asp:Repeater>            
        </div>
        <!--/列表-->

        <!--内容底部-->
        <div class="line10"></div>
        <table style="width:100%;">
            <tr style="width:100%;">
                <td style="width:66%;" align="left">
                    <div class="pagelist" style="margin-top:10px;">
                        <div class="l-btns">
                            <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                                OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
                        </div>
                        <div id="PageContent" runat="server" class="default"></div>
                    </div>
                </td>
                <td  style="width:33%;font-size:12px; padding-top:10px;" align="right" valign="top">                    
                    <table>
                        <tr>
                            <td>
                                合计:
                            </td>
                            <td align="center">
                                <asp:Label ID="lbtotal"  style="border-bottom:1px solid black;color:blue;" runat="server" Width="60px" ></asp:Label>(元)
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <!--/内容底部-->
    </form>
</body>
</html>